package com.gc.server.dao;

import com.gc.server.entity.CostApplyEntity;
import com.gc.server.vo.CostApplyVo;
import org.apache.ibatis.annotations.Mapper;
import com.yf.dao.BaseDao;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
 * 费用申请Dao
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Wed Oct 21 17:34:54 CST 2020
 */
@Mapper
public interface CostApplyDao extends BaseDao<CostApplyEntity> {

    List<CostApplyVo> findVo(CostApplyVo vo);

    CostApplyVo getVo(Long id);


    List<CostApplyVo> findByUser(@Param("userId") Long userId, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    List<CostApplyVo> findByPid(Long userId);

    BigDecimal sumAmount(@Param("date") Date date, @Param("userId") Long userId);

    BigDecimal sumAmountByTop(@Param("date") Date date, @Param("userId") Long userId);

    List<CostApplyVo> findByPidAndDate(@Param("userId") Long userId, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    int sumCheck(Long userId);

    CostApplyEntity findByBusId(Long id);
}
